import { ApiProperty } from '@midwayjs/swagger';

export class CreateSoilDataDTO {
  @ApiProperty({
    description: '数据采集时间',
    example: '2024-07-10T12:00:00.000Z',
  })
  time: Date;

  @ApiProperty({
    description: '电池电量(%)',
    example: 85,
    required: false,
  })
  batteryLevel?: number;

  @ApiProperty({
    description: '水分含量(%) - 10cm深度',
    example: 23.5,
    required: false,
  })
  moistureAt10cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 20cm深度',
    example: 27.2,
    required: false,
  })
  moistureAt20cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 30cm深度',
    example: 30.1,
    required: false,
  })
  moistureAt30cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 40cm深度',
    example: 32.8,
    required: false,
  })
  moistureAt40cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 50cm深度',
    example: 35.4,
    required: false,
  })
  moistureAt50cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 60cm深度',
    example: 36.9,
    required: false,
  })
  moistureAt60cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 70cm深度',
    example: 38.2,
    required: false,
  })
  moistureAt70cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 80cm深度',
    example: 39.5,
    required: false,
  })
  moistureAt80cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 90cm深度',
    example: 40.1,
    required: false,
  })
  moistureAt90cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 100cm深度',
    example: 41.3,
    required: false,
  })
  moistureAt100cm?: number;

  @ApiProperty({
    description: '地表温度(℃)',
    example: 28.5,
    required: false,
  })
  surfaceTemperature?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 10cm深度',
    example: 26.2,
    required: false,
  })
  temperatureAt10cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 20cm深度',
    example: 24.8,
    required: false,
  })
  temperatureAt20cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 30cm深度',
    example: 23.5,
    required: false,
  })
  temperatureAt30cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 40cm深度',
    example: 22.3,
    required: false,
  })
  temperatureAt40cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 50cm深度',
    example: 21.9,
    required: false,
  })
  temperatureAt50cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 60cm深度',
    example: 21.5,
    required: false,
  })
  temperatureAt60cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 70cm深度',
    example: 21.2,
    required: false,
  })
  temperatureAt70cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 80cm深度',
    example: 20.9,
    required: false,
  })
  temperatureAt80cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 90cm深度',
    example: 20.6,
    required: false,
  })
  temperatureAt90cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 100cm深度',
    example: 20.4,
    required: false,
  })
  temperatureAt100cm?: number;
}

export class UpdateSoilDataDTO {
  @ApiProperty({
    description: '主键ID',
    example: 1,
  })
  id: number;

  @ApiProperty({
    description: '数据采集时间',
    example: '2024-07-10T12:00:00.000Z',
    required: false,
  })
  time?: Date;

  @ApiProperty({
    description: '电池电量(%)',
    example: 85,
    required: false,
  })
  batteryLevel?: number;

  @ApiProperty({
    description: '水分含量(%) - 10cm深度',
    example: 23.5,
    required: false,
  })
  moistureAt10cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 20cm深度',
    example: 27.2,
    required: false,
  })
  moistureAt20cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 30cm深度',
    example: 30.1,
    required: false,
  })
  moistureAt30cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 40cm深度',
    example: 32.8,
    required: false,
  })
  moistureAt40cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 50cm深度',
    example: 35.4,
    required: false,
  })
  moistureAt50cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 60cm深度',
    example: 36.9,
    required: false,
  })
  moistureAt60cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 70cm深度',
    example: 38.2,
    required: false,
  })
  moistureAt70cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 80cm深度',
    example: 39.5,
    required: false,
  })
  moistureAt80cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 90cm深度',
    example: 40.1,
    required: false,
  })
  moistureAt90cm?: number;

  @ApiProperty({
    description: '水分含量(%) - 100cm深度',
    example: 41.3,
    required: false,
  })
  moistureAt100cm?: number;

  @ApiProperty({
    description: '地表温度(℃)',
    example: 28.5,
    required: false,
  })
  surfaceTemperature?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 10cm深度',
    example: 26.2,
    required: false,
  })
  temperatureAt10cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 20cm深度',
    example: 24.8,
    required: false,
  })
  temperatureAt20cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 30cm深度',
    example: 23.5,
    required: false,
  })
  temperatureAt30cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 40cm深度',
    example: 22.3,
    required: false,
  })
  temperatureAt40cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 50cm深度',
    example: 21.9,
    required: false,
  })
  temperatureAt50cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 60cm深度',
    example: 21.5,
    required: false,
  })
  temperatureAt60cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 70cm深度',
    example: 21.2,
    required: false,
  })
  temperatureAt70cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 80cm深度',
    example: 20.9,
    required: false,
  })
  temperatureAt80cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 90cm深度',
    example: 20.6,
    required: false,
  })
  temperatureAt90cm?: number;

  @ApiProperty({
    description: '土壤温度(℃) - 100cm深度',
    example: 20.4,
    required: false,
  })
  temperatureAt100cm?: number;
}

export class QuerySoilDataDTO {
  @ApiProperty({
    description: '数据ID',
    example: 1,
    required: false,
  })
  id?: number;

  @ApiProperty({
    description: '开始时间',
    example: '2024-07-01T00:00:00.000Z',
    required: false,
  })
  startTime?: Date;

  @ApiProperty({
    description: '结束时间',
    example: '2024-07-10T23:59:59.999Z',
    required: false,
  })
  endTime?: Date;

  @ApiProperty({
    description: '当前页码',
    example: 1,
  })
  current: number = 1;

  @ApiProperty({
    description: '每页显示的数量',
    example: 10,
  })
  pageSize: number = 10;
}

export class DeleteSoilDataDTO {
  @ApiProperty({
    description: '主键ID',
    example: 1,
  })
  id: number;
}

export class ImportSoilDataDTO {
  @ApiProperty({
    description: '批量导入的土壤数据',
    type: [CreateSoilDataDTO],
  })
  data: CreateSoilDataDTO[];
}
